#include "basic_form.h"

const std::wstring BasicForm::kClassName = L"Basic";

BasicForm::BasicForm()
{
}


BasicForm::~BasicForm()
{
}

std::wstring BasicForm::GetSkinFolder()
{
	return L"basic";
}

std::wstring BasicForm::GetSkinFile()
{
	return L"basic.xml";
}

std::wstring BasicForm::GetWindowClassName() const
{
	return kClassName;
}

void BasicForm::InitWindow()
{
	lb_session_ = static_cast<ui::ListBox*>(FindControl(L"list_session"));
	box_default_tips_ = static_cast<ui::Box*>(FindControl(L"box_default_tips"));
	tab_session_box_ = static_cast<ui::TabBox*>(FindControl(L"tab_session_box"));
	lb_session_->AttachSelect(std::bind(&BasicForm::onSelectSessionItem, this, std::placeholders::_1));
}

bool BasicForm::onSelectSessionItem(ui::EventArgs* e) {
    box_default_tips_->SetVisible(false);
    tab_session_box_->SetVisible(true);



    return true;
}

LRESULT BasicForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	PostQuitMessage(0L);
	return __super::OnClose(uMsg, wParam, lParam, bHandled);
}
